<!DOCTYPE html>
<html lang="en"><html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${sectionName}"></title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/css/communtiy.css">
    <script src="https://www.jq22.com/jquery/jquery-3.3.1.js"></script>
    <script src="/js/bootstrap.min.js" type="application/javascript"></script>
    <script src="/js/selfjs.js" type="application/javascript"></script>
</head>
<body>
<!--插入表头共同片段-->
<div th:insert="~{navaigation::nav}"></div>
<!--//问题首页-->
<div class="container-fluid main" >
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h3> <span th:text="${sectionName}"></span></h3>
            <hr>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" th:if="${section=='quesions' || section=='autor'}">
                <div class="media" th:each="quesionUserDto:${paginationDto.quesionUserDtos}">
                    <div class="media-left">
                        <a href="#">
                            <img class="media-object img-thumbnail" th:src="${quesionUserDto.getUsers().getAvatarUrl()}"  style="height: 50px;width: 50px;">
                        </a>
                    </div>
                    <div class="media-body">
                        <h3 class="media-heading">
                            <a th:href="@{'/quesion/'+${quesionUserDto.getId()}}" th:text="${quesionUserDto.getTitle()}"></a>
                        </h3>
                        <span class="text-desc"><span th:text="${quesionUserDto.getUsers().getName()}"></span>发表了文章 •
                        <span th:text="${quesionUserDto.getComment_count()}"></span> 个评论 •
                        <span th:text="${quesionUserDto.getView_count()}"></span> 次浏览 •
                        <span th:text="${#dates.format(quesionUserDto.getGmt_create(),'yyyy-MM-dd HH:mm')}"></span></span>
                    </div>
                </div>
                <!--分页-->
                <nav aria-label="Page navigation" th:if="${isOtherLook==null}">
                    <ul class="pagination">
                        <li th:if="${paginationDto.page>1}">
                            <a th:href="@{'/profile/'+${section}(page=1)}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <li th:each="pages:${paginationDto.pages}"  th:class="${paginationDto.page==pages}?'active':''">
                            <a th:text="${pages}" th:href="@{'/profile/'+${section}(page=${pages})}"></a></li>

                        <li th:if="${paginationDto.page<paginationDto.getCountPage()}">
                            <a th:href="@{'/profile/'+${section}(page=${paginationDto.getCountPage()})}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
                <nav aria-label="Page navigation" th:if="${isOtherLook!=null}">
                    <ul class="pagination">
                        <li th:if="${paginationDto.page>1}">
                            <a th:href="@{'/profile/'+${section}+'-'+${quesionId}(page=1)}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <li th:each="pages:${paginationDto.pages}"  th:class="${paginationDto.page==pages}?'active':''">
                            <a th:text="${pages}" th:href="@{'/profile/'+${section}+'-'+${quesionId}(page=${pages})}"></a></li>

                        <li th:if="${paginationDto.page<paginationDto.getCountPage()}">
                            <a th:href="@{'/profile/'+${section}+'-'+${quesionId}(page=${paginationDto.getCountPage()})}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>

            <!--通知u回复内容-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"th:if="${section=='replies'}" th:each="nottif:${notificationDtos}">
                    <!--回复的文章-->
                    <span th:if="${nottif.getType()==1}">
                             <span>
                                  <span class="glyphicon glyphicon-user replies" aria-hidden="true"
                                        th:text="${nottif.getNotified_user().getName()}">
                                  </span>
                                 <span><b>@你的</b></span>
                             </span>
                            <span><b>文章:</b></span>
                             <a th:href="@{'/notified/'+${nottif.getQuesion_id()}+'-'+${nottif.getId()}}" th:text="${nottif.getReciverQuesion()}"></a>
                            <span  style="margin-left: 20px;" th:text="${'@内容：'+nottif.getContent()}"></span>
                             <span class="glyphicon glyphicon-time" aria-hidden="true"
                                   style="font-size: 5px;" th:text="${#dates.format(nottif.getGmt_create(),'yyyy-MM-dd HH:mm')}">
                             </span>
                             <span th:if="${nottif.getStatus()==1}" class="label label-success"style="margin-left: 10px;">未读</span>
                             <span th:if="${nottif.getStatus()==2}" class="label label-default"style="margin-left: 10px;">已读</span>
                        </span>
                    <!--回复的评论-->
                    <span th:if="${nottif.getType()==2}">
                             <span>
                                  <span class="glyphicon glyphicon-user replies" aria-hidden="true"
                                        th:text="${nottif.getNotified_user().getName()}">
                                  </span>
                                 <span><b>@你的</b></span>
                             </span>
                            <span><b>评论:</b></span>
                             <a th:href="@{'/notified/'+${nottif.getQuesion_id()}+'-'+${nottif.getId()}}" th:text="${nottif.getReciverComment()}"></a>
                            <span  style="margin-left: 20px;" th:text="${'@内容：'+nottif.getContent()}"></span>
                             <span class="glyphicon glyphicon-time" aria-hidden="true"
                                   style="font-size: 5px;" th:text="${#dates.format(nottif.getGmt_create(),'yyyy-MM-dd HH:mm')}">
                             </span>
                            <span th:if="${nottif.getStatus()==1}" class="label label-success"style="margin-left: 10px;">未读</span>
                             <span th:if="${nottif.getStatus()==2}" class="label label-default" style="margin-left: 10px;">已读</span>
                        </span>
                    <hr class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                </div>
                <nav aria-label="..." th:if="${section=='replies'}">
                    <ul class="pager" th:if="${notificationDtos.size()!=0}">
                        <li><a th:href="@{'/profile/'+${section}(page=1)}">首页</a></li>
                        <li><a th:if="${cruuentPages==1}" href="#">上一页</a></li>
                        <li><a th:if="${cruuentPages!=1}" th:href="@{'/profile/'+${section}(page=${cruuentPages-1})}">上一页</a></li>
                        <li><a th:if="${countPage!=cruuentPages}" th:href="@{'/profile/'+${section}(page=${cruuentPages+1})}">下一页</a></li>
                        <li><a th:if="${countPage==cruuentPages}" href="#">下一页</a></li>
                        <li><a th:href="@{'/profile/'+${section}(page=${countPage})}">未页</a></li>
                    </ul>
                    <ul th:if="${notificationDtos.size()==0}">
                        <a href="/"><h3 style="text-align: center">亲,目前还没有人回复你,点我去论坛看看</h3></a>
                        <img src="/img/noaction.jpg" style="height: 500px;width: 300px;margin-left: 350px;">
                    </ul>
                </nav>
        </div>

            <!--我的评论信息-->
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" th:if="${section=='comment'}" style="height: 550px;">

                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" th:if="${commentListDtos.size()!=0}">
                    <a th:href="@{'/profile/'+${section}(sort=${sortTime})}"><span class="glyphicon glyphicon-resize-vertical self_leave3" aria-hidden="true">回复时间排序</span></a>
                    <a th:href="@{'/profile/'+${section}(sort=${sortFabulos})}"><span class="glyphicon glyphicon-resize-vertical self_leave3" aria-hidden="true">回复获赞排序</span></a>

                </div>
                <div class="media col-lg-6 col-md-12 col-sm-12 col-xs-12" th:each="comments:${commentListDtos}" style="margin-top: 20px;">
                    <div class="media-left">
                            <img class="media-object" th:src="${comments.getUsers().getAvatarUrl()}" style="width: 60px;height: 60px;">

                    </div>
                    <div class="media-body">
                        <h4 class="media-heading">
                            <span th:text="${'博主:'+comments.getUsers().getName()}" class="self_leave2"></span>
                            <span th:text="${'等级Lv:'+comments.getUsers().getLeave()}" class="self_leave2"></span>
                            <span th:text="${'粉丝:'+comments.getUsers().getFensi_count()}" class="self_leave2"></span>
                            <span class="glyphicon glyphicon-trash" aria-hidden="true" style="float: right" onclick="delComment(this)" th:id="${comments.getId()}"></span>
                        </h4>
                        <a th:href="@{'/quesion/'+${comments.getQuesions().getId()}}">
                            <b style="margin-top: 5px;"><span  style="color: black">他的帖子标题：</span></b><span th:text="${comments.getQuesions().getTitle()}" class="self_leave2"></span>
                        </a>
                        <br>
                        <b style="margin-top: 5px;"><span  style="color: black">我回复的内容：</span></b><span th:text="${#strings.abbreviate(comments.getContent(),20)}" class="self_leave2"></span>
                        <br>

                       <span th:text="${#dates.format(comments.getGmt_create(),'yyyy-MM-dd HH:mm')}" class="glyphicon glyphicon-time self_mes" aria-hidden="true"></span>
                        <span th:text="${comments.getFabulous_down()}" class="glyphicon glyphicon-thumbs-up self_mes" aria-hidden="true"></span>
                        <span th:text="${comments.getFabulous_up()}" class=" glyphicon glyphicon-hand-down  self_mes" aria-hidden="true"></span>

                    </div>
                </div>
                <!--分页--->
                <nav aria-label="..." th:if="${commentListDtos.size()!=0}"class="col-lg-12 col-md-12 col-sm-12 col-sm-12 col-xs-12">
                    <ul class="pager">
                        <li class="">
                            <a th:href="@{'/profile/'+${section}(page=1,sort=${sort})}" aria-label="Previous">首页
                            </a>
                        </li>
                        <li class="">
                            <a th:if="${commentListDtos.get(0).getPage()!=1}" th:href="@{'/profile/'+${section}(page=${commentListDtos.get(0).getPage()-1},sort=${sort})}">上一页</a>
                            <a th:if="${commentListDtos.get(0).getPage()==1}" href="#" class="disabled">上一页</a>
                        </li>
                        <li class="">
                            <a th:if="${commentListDtos.get(0).getPage()==commentListDtos.get(0).getCountPage()}" href="#">下一页</a>
                            <a th:if="${commentListDtos.get(0).getPage()!=commentListDtos.get(0).getCountPage()}" th:href="@{'/profile/'+${section}(page=${commentListDtos.get(0).getPage()+1},sort=${sort})}" class="disabled">下一页</a>

                        </li>
                        <li class="">
                            <a  th:href="@{'/profile/'+${section}(page=${commentListDtos.get(0).getCountPage()},sort=${sort})}">尾页</a>
                        </li>

                    </ul>
                </nav>
                <ul th:if="${commentListDtos.size()==0}">
                    <a href="/"><h3 style="text-align: center">亲,目前还没有参与回复,点我去论坛看看</h3></a>
                    <img src="/img/noaction.jpg" style="height: 500px;width: 300px;margin-left: 350px;">
                </ul>
            </div>


         </div>


        <div class="col-lg-3 col-md-12 col-sm-12 col-sm-12 col-xs-12" th:if="${isOtherLook==null}">
            <div class="list-group" style="margin-top: 15px;">
                <a href="/profile/quesions" th:class="${section=='quesions'}?'list-group-item active':'list-group-item'">我的帖子</a>
                <a href="/profile/comment" th:class="${section=='comment'}?'list-group-item active':'list-group-item'">我的评论</a>
                <a href="/profile/replies" th:class="${section=='replies'}?'list-group-item active':'list-group-item'">最新回复
                    <spna class="badge" th:text="${noReadConut}"></spna>
                </a>
            </div>
            <hr>
        </div>
    </div>
</div>

</body>

</html>